<%--
    Document   : produits
    Created on : 9 mai 2012, 11:34:29
    Author     : Thomas
--%>

<%@include file="_header.jsp" %>
<%@include file="_left.jsp" %>

<%! String error_msg; %>
<% error_msg = (String)request.getAttribute("error_msg"); %>

<%! Product product; %>
<% product = (Product) request.getAttribute("product");%>

<% if (error_msg != null) { %>
<div class="span7">
    <h3>Oups !</h3>
    <br/>
    <div class="alert-error"><strong><%= error_msg %></strong></div>
    <hr/>
    <div class="row-fluid">
        <div class="pull-right">
            <a class="btn btn-primary" href="<%= request.getContextPath() %>">OK</a>
        </div>
    </div>
</div>
<% } else { %>
<div class="span5">
    <h3><%= product.getName() %></h3>
    <br/>
    <%= product.getDescription() %>
</div>
<div class="span2">
    <h3><%= product.getPrice() %>&nbsp;&euro;</h3>
    <br/>
    <% if(product.getStock() > 0) { %>
        <p><a href="<%= request.getContextPath() %>/Basket?action=ajouterProduit&productID=<%= product.getID() %>"><i class="icon-plus-sign"></i>&nbsp;ajouter au panier</a></p>
    <% } else { %>
        <p style="color: red;">rupture</p>
    <% } %>
</div>
<% } %>

<%@include file="_right.jsp" %>
<%@include file="_footer.jsp" %>